package com.dkts.oil.converter;

import com.dkts.oil.util.GeoOutUtil;
import com.dkts.oil.util.WriterToFileUtil;
import org.locationtech.jts.geom.Geometry;

import java.io.BufferedWriter;

public class WriterToFile {

    public static void writerFileGeoJson(String url, Geometry polygon){
        String geojson2= GeoOutUtil.dataDrawPolygon(polygon);
        writerFileGeoJson(url, geojson2);
    }

    public static void writerFileGeoJsonLine(String url, Geometry polygon){
        writerFileGeoJson(url,  GeoOutUtil.dataDrawLineString(polygon));
    }

    public static void writerFileGeoJson(String url, String data){
        BufferedWriter bufferedWriter= WriterToFileUtil.getWriterBuffer(url,false);
        WriterToFileUtil.writer(bufferedWriter,data);
    }
}
